package org.amicofragile.unitdsl.category

import org.amicofragile.unitdsl.Unit
import org.amicofragile.unitdsl.Distance

class DistanceCategory {
	static Distance getM(Number n) {
		new Distance(length : n, unit : Unit.m)
	}
	static Distance getM(Distance d) {
		new Distance(length : Unit.convertUnit(d, Unit.m), unit : Unit.m)
	}
	static Distance getYd(Number n) {
		new Distance(length : n, unit : Unit.yd)
	}
	static Distance getYd(Distance d) {
		new Distance(length : Unit.convertUnit(d, Unit.yd), unit : Unit.yd)
	}
}
